


<!DOCTYPE html>
<html lang="en">

<head>
    
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>在线时间戳 Unix timestamp在线工具-postjson</title>
    <meta name="robots" content="all" />
    <meta name="keywords" content="时间戳,转换,unix timestamp,Unix时间戳转换,时间戳转换工具" />
    <meta name="description" content="时间戳转换北京时间的工具" />
    <link rel="shortcut icon" href="/static/coolaf/img/favicon.ico">
    
    
    <script src="/static/coolaf/js/ie-emulation-modes-warning.js"></script>

    
    
    
    <link rel="stylesheet" href="/static/coolaf/bootstrap/css/bootstrap.min.css">
    <script src="/static/coolaf/js/jquery.min.js"></script>
    <link rel="stylesheet" href="/static/coolaf/css/offcanvas.css">
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

</head>
<script>
        var showToast = function (msg,option) {
        outTime = 3000;
        if (option&&option.outTime) {
            outTime = option.outTime;
        }
        if (!$(".showtoastresult").html()) {
            html = "<div class='showtoastresult' style='min-width: 50px;width: auto;padding: 10px 20px;font-size: 14px;font-weight: bold;background: rgba(7, 17, 27, 0.66);border-radius: 6px;color: rgb(255, 255, 255);top: 50%;z-index: 1000001;transform: translate3d(-50%, -50%, 0px);position: fixed;top: 50%;left: 50%;-webkit-transform: translate(-50%, -50%);-moz-transform: translate(-50%, -50%);-ms-transform: translate(-50%, -50%);-o-transform: translate(-50%, -50%);transform: translate(-50%, -50%);'></div>";
            $(document.body).append(html);
        }
        $(".showtoastresult").html(msg);    
        $(".showtoastresult").fadeIn("slow").fadeOut(3000);
        return false;
    }
</script>
<style>
    .navbar-brand,.navbar-nav>li>a{
        color:#fdfdfd!important;
    }
    .navbar-nav>li>a:hover{
        color:#ff8839!important;
    }
</style>
<body >
    
	<script>
	$("#black1").click(function(){
		var s = $(this).html();
		if (s=="夜间模式") {
			$('body').css("background-color","black");
			$('body').css("opacity","0.7")
			$('body').css("-moz-opacity","0.7")
			$('body').css("filter","alpha(opacity=50)")
			$(this).html('白天模式');
		}else{
			$('body').css("background-color","");
			$('body').css("opacity","")
			$('body').css("-moz-opacity","")
			$('body').css("filter","")
			$(this).html('夜间模式');
		}
	});
	</script>
    
    <div class="container">

        <div class="row row-offcanvas row-offcanvas-right main-contain">
            
            <div class="col-xs-12 col-sm-9">
                
                
              
<h3>时间、时间戳转换</h3>
<br/>
<div>
<div>
  <div class="input-group" style='width:60%;float:left'>
    <span class="input-group-addon" id="basic-addon1">当前时间戳：</span>
    <input type="text" class="form-control" id="curr_time" aria-describedby="basic-addon1">
	<span class="input-group-addon" id="basic-addon1">北京时间：</span>
    <input type="text" class="form-control" id="curr_date_time" aria-describedby="basic-addon1" style='width:160px'>
  </div>
	<div class="btn-group" role="group" aria-label="..." style='width:25%;float:left;margin-left:20px'>
	  <button type="button" class="btn btn-primary codeurl" onclick='start();'>开始</button>
	  <button type="button" class="btn btn-primary codeurl" onclick='cl();'>暂停</button>
	</div>
</div>
<br/>
  <div style='margin-top:50px;line-height:40px;clear:both'>
    <div style='font-size:10px;margin-left:10px'>时间戳->北京时间</div>
    <div class="input-group" style='width:38%;float:left'>
      <span class="input-group-addon" id="basic-addon1">时间戳：</span>
      <input type="text" class="form-control" id="otime" aria-describedby="basic-addon1">
    </div>
    <button type="button" class="btn btn-primary" id='changetime' style='width:18%;float:left;margin-left:10px;margin-right:10px'>转 换</button>
	<div class="input-group" style='width:38%;float:left'>
	    <span class="input-group-addon" id="basic-addon1">北京时间：</span>
	    <input type="text" class="form-control" id="bei_time" aria-describedby="basic-addon1">
    </div>
</div>
<div style='margin-top:50px;line-height:40px;clear:both'>
    <div style='font-size:10px;margin-left:10px'>北京时间->时间戳</div>
    <div class="input-group" style='width:38%;float:left'>
      <span class="input-group-addon" id="basic-addon1">北京时间：</span>
      <input type="text" class="form-control" id="beic_time" aria-describedby="basic-addon1">
    </div>
    <button type="button" class="btn btn-primary" id='changetimec' style='width:18%;float:left;margin-left:10px;margin-right:10px'>转 换</button>
	<div class="input-group" style='width:38%;float:left'>
	    <span class="input-group-addon" id="basic-addon1">时间戳：</span>
	    <input type="text" class="form-control" id="octime" aria-describedby="basic-addon1">
    </div>
</div>
</div>


<script>
$(document).ready(function(){
   $("#otime").val(parseInt(new Date().getTime()/1000));
   $("#beic_time").val(formatDate(new Date()));
   $("#changetime").click(function(){
       var otime=   $("#otime").val();
       if (otime=="") {
         alert("时间戳不能为空");
         $("#otime").focus();
         return false;
       }
	console.log(otime)
       $("#bei_time").val(formatDate(new Date(otime*1000)));
   });

  $("#changetimec").click(function(){
       var beic_time=   $("#beic_time").val();
       if (beic_time=="") {
         alert("时间戳不能为空");
         $("#beic_time").focus();
         return false;
       }
	console.log(beic_time)
       $("#octime").val(transdate(beic_time));
   });
});
function   formatDate(now)   {    
              var   year=now.getFullYear();     
              var   month=now.getMonth()+1;     
              var   date=now.getDate();     
              var   hour=now.getHours();     
              var   minute=now.getMinutes();     
              var   second=now.getSeconds();     
              return   year+"-"+(month=month<10?("0"+month):month)+"-"+(date=date<10?("0"+date):date)+" "+(hour=hour<10?("0"+hour):hour)+":"+(minute=minute<10?("0"+minute):minute)+":"+(second=second<10?("0"+second):second);     
   } 
function transdate(endTime){
	var date=new Date("2000-0-1");
	$month=endTime.substring(5,7);
	$day=endTime.substring(8,10);
	if ($month<1||$month>12) {
		alert("北京时间月份不正确。");
		$("#beic_time").focus();
		return false;
	}
	if ($day<1||$day>31) {
		alert("北京时间日不正确。");
		$("#beic_time").focus();
		return false;
	}
	date.setFullYear(endTime.substring(0,4));
	date.setMonth($month-1);
	date.setDate($day);
	date.setHours(endTime.substring(11,13));
	date.setMinutes(endTime.substring(14,16));
	date.setSeconds(endTime.substring(17,19));
	return Date.parse(date)/1000;
}
var arr = new Array();
start();
function start() {
var ii=setInterval(function(){
  var tt= new Date();
  $("#curr_time").val(parseInt(tt.getTime()/1000));
  $("#curr_date_time").val(formatDate(tt));
  console.log(ii);
},1000);
arr.push(ii);	
}
function cl() {
	while(i=arr.pop()){
	  clearInterval(i);
	}
	arr = new Array();
}
</script>

<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?2db240112a8dbb4d6a2869381e5fbfed";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>



 </div>
	
    </div>
</div>


  <script src="/static/coolaf/bootstrap/js/bootstrap.min.js"></script>
  <script src="/static/coolaf/js/offcanvas.js"></script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?18f18be6e58f13d87192835c8c15fdca";
  var s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(hm, s);
})();
</script>
<script>
try{
　　top.location.hostname;
　　if (top.location.hostname != window.location.hostname) {
　　　　top.location.href =window.location.href;
　　}
}
catch(e){
　　top.location.href = window.location.href;
}
</script>
<script>
$.ajax({
	  url:"/side",
	  type:"GET",
	  dataType:"jsonp",
	  success:function(data){
		
		$(".sideclass").each(function(){
			
		});
	  }
     });
</script>

<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>
<script>
$(document).ready(function () {
		$("#newpayup").click(function () {
			$("#payup").show();
		});
		$("#payup").click(function () {
			$(this).hide();
		});
});
</script>
<style>
		.payup {
			display: none;
			position: fixed;
			top: 0px;
			left: 0px;
			width: 100%;
			height: 100%;
			background: rgba(0, 0, 0, 0.6);
			z-index: 6666
		}

		.postpay {
			position: relative;
			float: right;
		}

		.postpay button {
			color: yellow;
			width: 68px;
			height: 50px;
			word-wrap: break-word;
			background-color: hsl(340, 100%, 75%);
			box-shadow: inset rgba(255, 254, 255, 0.6) 0 0.3em .3em, inset rgba(0, 0, 0, 0.15) 0 -0.1em .3em, hsl(340, 70%, 50%) 0 .1em 3px, hsl(340, 80%, 40%) 0 .3em 1px, rgba(0, 0, 0, 0.2) 0 .5em 5px;
			border: none;
			padding-right: 1.2em;
			padding-left: 0.8em;
			border-radius: 3em 1em / 5em 1em;
		}

		.payupimg {
			width: 680px;
			height: 390px;
			margin: 0 auto;
			position: relative;
			top: 256px;
			z-index: 9999;
			background: white;
		}

		.payup img {
			float: left;
			width: 280px;
			height: 280px;
			margin:30px 30px 30px 30px;
		}

		.imgtext {
			width: 330px;
			display: inline-block;
			text-align: center;
			font-size: 20px;
			font-weight: blod;
		}
	</style>
	<div class='payup' id='payup'>
		<span></span>
		<div class='payupimg'>
			<img src="/static/coolaf/img/zfb.png" >
			<img src="/static/coolaf/img/wx.png" >
			<div>
				<span class='imgtext'>支付宝</span>
				<span class='imgtext'>微信</span>
			</div>
		</div>
	</div>
</body>
</html>
